Add AI/LLM policy support ("a" type) with natural language evaluation#1695
Add AI/LLM policy support ("a" type) with natural language evaluation#1695
Conversation
|
|
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
…ror logging Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
|
@copilot fix failed CI check: https://github.com/casbin/casbin/actions/runs/21330100245?pr=1695 |
…o ai_api.go Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
... Fixed both CI issues in commit e2bab52:
All tests pass successfully. |
Benchmark ComparisonComparing base branch ( 🤖 This comment will be automatically updated with the latest benchmark results. |
|
@copilot change "description" to "prompt" everywhere in the code |
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
... Changed "description" to "prompt" everywhere in commit 9b12cb4:
All tests pass successfully. |
Implementation Plan for AI/LLM Policy Support ("a" type)
Summary
Successfully implemented AI/LLM policy support ("a" type) in Casbin with comprehensive error handling and robust parsing.
Recent Changes:
a = promptinstead ofa = descriptionpolicyDescriptiontopolicyPromptCore Changes:
Files Modified/Created:
model/model.go- Added "a" section supportmodel/policy.go- Added ClearPolicy support for "a" policiesai_api.go- Added evaluateAIPolicy() with robust parsing, uses "prompt" terminologyai_policy_api.go- Complete management APIenforcer.go- Integrated AI policy evaluation with reduced complexity, uses "prompt" terminologyai_policy_api_test.go- Comprehensive test suiteexamples/ai_policy_model.conf- Uses "a = prompt" definitionTesting:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.